Import('RTT_ROOT')
Import('rtconfig')
from building import *

cwd = GetCurrentDir()

# 添加驱动文件，Split函数为正则表达式匹配时常用的分割函数
src = Split("""
board.c
../rtconfig.h
""")

# 添加头文件路径
CPPPATH = [cwd,cwd + '/MCUX_Config']

# 链接时的参数
#cpu型号参考SDK下的fsl_device_registers.h文件
#CPPDEFINES = ['CPU_MK60DN512VLQ10']
CPPDEFINES = ['CPU_MK60DN512VLQ10', 'STD=C99', 'SKIP_SYSCLK_INIT']


if rtconfig.CROSS_TOOL == 'keil':
    CPPDEFINES.append('__FPU_PRESENT=1')
    
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)

Return('group')